home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Scene Storm
/
Scene Storm - Volume 1.iso
/
coding
/
c
/
unixdirsii
/
unixdirsii.doc
< prev
next >
Wrap
Text File
|
1995-11-05
|
3KB
|
87 lines
short: patch DOS to use . and .. ala UNIX
UnixDirsII Version 1.0, by Martin W. Scott
------------------------------------------
PUBLIC DOMAIN, NO WARRANTIES ATTACHED
REQUIRES KickStart 2.04 OR HIGHER (SO FAR, UNTESTED ON KS 3.0)
Sick and tired of typing '..' when you should have typed '/'? Hate having
to switch to Amiga path specifications? Then UnixDirsII is for you.
UnixDirsII was written because the original UnixDirs (by Murray Bennett and
Mark Cyster) broke under 2.0. This version has absolutely nothing to do
with the original, except that it provides the same function.
The Unix path convention isn't necessarily better than the Amiga's, in fact
there's not much between them, but I'm sure I'm not alone in always
mistakenly using Unix paths when I'm using my Amiga. If you don't use Unix,
you can safely ignore this program.
UnixDirsII adjusts paths passed to certain DOS functions in the following
way:
- a leading '.' means the calling task's current directory
- '..' and '../' mean '/' (back up a level)
Note that '.' only has special significance at the start of a
path-sprcification. I have opted not to incorporate handling of a leading
'/' to mean ROOT, as this may lead to ambiguities and conflicts in programs
that do their own path manipulation.
It's best started from WBStartup, unless you want to use Unix paths in your
Startup-sequence or user-startup, in which case you should 'run >nil:
UnixDirsII' before you use the new paths. In most cases, this wont be
necessary. When starting UnixDirsII from Workbench, it'll use about 8K.
Calling UnixDirsII again will remove it, but not all memory will be freed
(to avoid SetFunction conflicts). However, restarting UnixDirsII won't use
up any more memory, it reuses what it left before.
You can disable and re-enable UnixDirsII from the Commodities Exchange in
the obvious way. This may be useful if a particular program experiences
problems whilst UnixDirsII is running.
Notes/Problems/Oversights
-------------------------
System routines that are patched:
AssignLate, AssignPath, CreateDir, DeleteFile
LoadSeg, Lock, MatchFirst, NewLoadSeg, Open
ParsePattern, Rename, SetComment, SetFileDate
SetFileSize, SetProtection
Things that aren't patched that maybe ought to be:
ExAll with pattern (DOS seems to use an internal ParsePattern)
Notify routines - not really necessary to patch?
I haven't as yet experienced any problems on these fronts.
Programs that use their own routines to manipulate paths may have problems.
Lha is one such program. I've tried to fix it, thus far without success, so
don't use . and .. in path specifications.
Distribution
------------
UnixDirsII is placed in the public domain, which means people can modify
and redistribute it as they like (hopefully improved versions). I would ask
that if you distribute a modified version, make sure it is clear in the
docs that you are the person to come running to for help/flames etc.
UnixDirsII comes with no warranties. Use it entirely at your own risk.
Finally
-------
UnixDirsII was written entirely in C (yes, these things can be done in C),
compiled with SAS/C v5.10. The routines are patched in a method based on
that in ISpy, a CBM-provided AmigaMail example.
Contact:
Martin W. Scott
23 Drum Brae North
Edinburgh EH4 8AT
United Kingdom.
or email: mws@castle.ed.ac.uk